<?php

class Login_model extends CI_Model {

    var $table   = 'admin_user';

    function __construct()
    {
        parent::__construct();
    }
    
    function check_pass($user)
    {
        $sql = 'select id, user, pass, nickname, add_time, status from ' . $this->table . ' where user=? and status=? limit 1';
        $cond = array($user, 0);
		$re_obj = $this->db->query($sql, $cond);
		
		if ($re_obj->num_rows() > 0){
			$_re = $re_obj->result_array();
			$re = $_re[0];
			$re_obj->free_result();
		}else {
			$re = array();
		}
		return $re;
    }

}
